package sctu.edu.java.year2016.team05.xionglianjin.day20160523.chapter6_1;

/**
 * Created by lianjin on 2016/5/23.
 *判断字符串"mingrikejijavabu"中字符'i'出现了几次，并将结果输出
 */
public class Number {
    public static void main(String[] args){
        char arr[]={'m','i','n','g','r','i','k','e','j','i','j','a','v','a','b','u'};
        int i,num=0;
        for(i=0;i<arr.length;i++){
            if(arr[i]=='i')
                num=num+1;
        }
        System.out.println("i共出现了："+num+"次");
    }
}
